<?php
namespace app\command;

use app\admin\model\course\Order;
use EasyWeChat\Factory;
use extendwechat\Message;
use think\Cache;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\Db;
class Test extends Command
{
    //crontab -l //计划任务列表
    //crontab -e //编辑新增
    //centos crond 重启命令
    //systemctl restart crond
    //linux服务器设置定时任务 */1 * * * *  cd /项目的根路径 &&  php think task >> /dev/null 2>&1

    protected function configure()
    {
        $this->setName('test')
            ->setDescription('测试');
    }

    protected function execute(Input $input, Output $output)
    {

        $config = get_addon_config('third');
        $output->writeln("开始测试");
        $app = Factory::officialAccount($config['wechatWeb']);
        $a = $app->template_message->send([
            'touser' => "ohG-I5t5Y3zpsDUTFcajhgJntJwo",
            'template_id' => 'DmmfGtobG6FiXsYo0EmGE7QSPTXqI7AQ9VOEqIikij8',
            'miniprogram' => [
                'appid' => 'wx27b477d1ffb878a4',
                'pagepath' => 'pages/tabbar/index',
            ],
            'data' => [
                'thing2' => config("site.name"),
                'thing7' => "11",
                'thing8' => 22,
                'time5' => "2023-11-23 10:00",
                'thing9' => "学校",
            ],
        ]);
        dump($a);exit;
    }





}